<template>
  <el-dialog
    title="编辑"
    :visible.sync="dialogVisible"
    :before-close="close"
    width="30%"
  >
    <el-form label-width="120px">
      <el-form-item label="修改名称">
        <el-input v-model="orgName" size="mini" />
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="confirm">确 定</el-button>
      <el-button @click="close">取 消</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  data () {
    return {
      dialogVisible: false,
      orgName: '',
      id: '',
      level: ''
    }
  },
  methods: {
    open (id, level) {
      this.id = id
      this.level = level
    },
    confirm () {
      this.$emit('updateTree', 0)
    },
    close () {
      this.id = ''
      this.level = ''
      this.orgName = ''
      this.dialogVisible = false
    }
  }
}
</script>
